<?php
require_once "dbconnector.php";
$db = opendatabase();
$res = mysql_query("SELECT * FROM produto ORDER BY descricao");
?>

<style type="text/css">
	<!--
	.style1 {
		width: 735px;
		border: none;
	}
	.style2 {
		background-color: #62C502;
		font-weight: bold;
		text-align: center;
	}
	.val {
		width: 90px;
		text-align: center;
	}
	.opt {
		width: 20px;
	}
	-->
</style>

<h2>Produtos</h2>

<table class="style1">
	<tr>
		<td class="style2">Descrição</td>
		<td class="style2">Valor</td>
		<td class="style2" width="20">
			<img src="../images/preview16.gif" alt="Alterar" />
		</td>
		<td class="style2" width="20">
			<img src="../images/stop16.gif" alt="Excluir" />
		</td>
	</tr>
	<?php
		while($escrever=mysql_fetch_array($res))
        {
        // Escreve cada linha da tabela
        	echo "
        		<tr>
        		<td>" . strtoupper($escrever["descricao"]) . "</td>
        		<td class='val'>R$ " . number_format($escrever["valor"]/100,2,',','.') . "</td>
        		<td class='opt'>
        			<img src='../images/preview16.gif' alt='Alterar' />
        		</td>
        		<td class='opt'>
        			<img src='../images/stop16.gif' alt='Excluir' />
        		</td>
        		</tr>
        	";        	
		}
	?>
</table>

